#include "stdafx.h"
#include "ResultManager.h"
#include "../FrameRcognizeAlgorithm/FrameAnalyze.h"
CResultManager* CResultManager::m_resmanager = NULL;
map<CString,dataFile> CResultManager::m_Result;
CResultManager::CResultManager(void)
{
}


CResultManager::~CResultManager(void)
{
}

CResultManager* CResultManager::GetInstance()
{
	if ( m_resmanager == NULL )
		m_resmanager = new CResultManager();
	return m_resmanager;
}

void CResultManager::AddResult(CString strFile)
{
	CFrameAnalyze ana(strFile);
	ana.Analyze();
	dataFile a;
	ana.GetFileData(a);
    m_Result[strFile] = a;
}

void CResultManager::DelResult(CString strFile)
{
	for ( auto ite = m_Result.begin() ; ite != m_Result.end() ; ite++ )
	{
		if ( ite->first.Compare(strFile) == 0 )
		{
			m_Result.erase(ite);
			break;
		}
	}
}
